// import rollVue from "../../pages/roll/roll.vue"
import {
	request
} from "../indexsd.js"
// 热门宝箱
export function get_box_hot() {
	return request({
		url: `/box/hot`,
		method: 'get',
	})
}
// 宝箱列表
export function getWelfare() {
	return request({
		url: '/welfare',
		method: 'GET'
	})
}
// 获取用户信息
export function getUsetInof() {
	return request({
		url: `/me`,
		method: 'get'
	})
}

// roll房
export function getROllListthree() {
	return request({
		url: `/rooms?status=0`,
		method: 'get',
	})
}
// 参与roll房记录
export function getUserRooms() {
	return request({
		url: `/user/rooms`,
		method: 'get'
	})
}
// 宝箱详情
export function getBoxDetail(id) {
	return request({
		url: `/box/detail?id=${id}`,
		method: 'GET'
	})
}
// roll房间列表
export function getRoomsList(page, status) {
	return request({
		url: `/rooms?page=${page}&status=${status}`,
		method: 'get'
	})
}
// 打开宝箱
export function openWelfare(data) {
	return request({
		url: '/welfare/open',
		method: 'POST',
		data
	})
}
export function getBoxList() {
	return request({
		url: `/box/list`,
		method: 'get'
	})
}
// 我的背包
export function get_storage(page) {
	return request({
		url: `/storage?page=${page}`,
		method: 'get',
	})
}
// 提取饰品
export function getExtract(data) {
	return request({
		url: `/extract`,
		method: 'post',
		data

	})
}
// 回收饰品
export function getRecycle(data) {
	return request({
		url: `/cash`,
		method: 'post',
		data
	})
}
// 更换头像
export function getImageBase64(data) {
	return request({
		url: `/image/base64`,
		method: 'post',
		data
	})
}
// 更新头像
export function getSet_avatar(data) {
	return request({
		url: `/set_avatar`,
		method: 'post',
		data
	})
}
// 更新昵称
export function getSet_name(data) {
	return request({
		url: `/set_name`,
		method: 'post',
		data
	})
}
// 绑定steam
export function getSet_steam_url(data) {
	return request({
		url: `/set_steam_url`,
		method: 'post',
		data
	})
}
// 获取对战列表
export function getPKarenaList(page) {
	return request({
		url: `/arena/list?page=${page}`,
		method: 'get'
	})
}
// 历史对战记录
export function getPKarenaHistory(page) {
	return request({
		url: `/arena/history?page=${page}`,
		method: 'get'
	})
}
// 我的历史对战记录
export function getPKarenaMyHistory(page) {
	return request({
		url: `/arena/me-history?page=${page}`,
		method: 'get'
	})
}
// 武器饰品列表
export function getluckyList(page = 1, type_id = 0, name = '', start = 0, end = 0, sort = 1) {
	if (name != '') {
		return request({
			url: `/lucky/list?page=${page}&type_id=${type_id}&name=${name}&sort=${sort}`,
			method: 'get'
		})
	}
	if (end == 0) {
		return request({
			url: `/lucky/list?page=${page}&type_id=${type_id}&sort=${sort}`,
			method: 'get'
		})
	}
	if (end != 0) {
		return request({
			url: `/lucky/list?page=${page}&type_id=${type_id}&start=${start}&end=${end}&sort=${sort}`,
			method: 'get'
		})
	}
}
//实名认证
export function checkidcards(data) {
	return request({
		url: `/user/checkidcard`,
		method: 'post',
		data
	})
}
// 福利中心抽奖页面
export function get_banners() {
	return request({
		url: `/welfare`,
		method: 'get',
	})
}
// 开箱记录
export function getBoxDetail_det(id) {
	return request({
		url: `/box/detail?id=${id}`,
		method: 'get'
	})
}
// 打开箱子
export function getBoxOpen(data) {
	return request({
		url: `/box/open`,
		method: 'post',
		data
	})
}
// 回收箱子
export function getRecycled(data) {
	return request({
		url: `/cash`,
		method: 'post',
		data
	})
}
// 经典盲盒排行榜
export function getRank(data) {
	return request({
		url: `/box/ranking`,
		method: "get",
		data
	})
}
//盲盒对战排行榜
export function getRankTwo(data) {
	return request({
		url: "/arena/user-ranking",
		method: "get",
		data
	})
}
//幸运饰品排行榜
export function getRankThree(data) {
	return request(({
		url: "/lucky/ranking",
		method: "get",
		data
	}))
}
//任务列表
export function getTaskList(data) {
	return request(({
		url: "/task/list",
		method: "get",
		data
	}))
}
//获取任务中心配置
export function getTaskCenter(data) {
	return request(({
		url: "/task/center",
		method: "get",
		data
	}))
}
//通知列表
export function getNotifications(data) {
	return request(({
		url: "/notifications",
		method: "get",
		data
	}))
}
//标记已读
export function isRead(data) {
	return request(({
		url: "/notifications/read",
		method: "post",
		data
	}))
}

export default {
	getWelfare,
	getBoxDetail,
	openWelfare,
	getUsetInof,
	get_box_hot,
	getBoxList,
	getROllListthree,
	getUserRooms,
	getRoomsList,
	get_storage,
	getExtract,
	getRecycle,
	getImageBase64,
	getSet_avatar,
	getSet_name,
	getSet_steam_url,
	getPKarenaList,
	getPKarenaHistory,
	getPKarenaMyHistory,
	getluckyList,
	checkidcards,
	get_banners,
	getBoxDetail_det,
	getBoxOpen,
	getRecycled,
	getRank,
	getRankTwo,
	getRankThree,
	getTaskList,
	getTaskCenter,
	getNotifications,
	isRead
}